// (C) 2022 Intel Corporation. All rights reserved.
// Your use of Intel Corporation's design tools, logic functions and other 
// software and tools, and its AMPP partner logic functions, and any output 
// files from any of the foregoing (including device programming or simulation 
// files), and any associated documentation or information are expressly subject 
// to the terms and conditions of the Intel Program License Subscription 
// Agreement, Intel FPGA IP License Agreement, or other applicable 
// license agreement, including, without limitation, that your use is for the 
// sole purpose of programming logic devices manufactured by Intel and sold by 
// Intel or its authorized distributors.  Please refer to the applicable 
// agreement for further details.

// A 128 bit PRNG - requires a 256 bit seed
module A_cse_ocs_dpa_aes10c_xorshift(
    input logic [255:0]     seed,
    input logic             reseed,
    input logic             clk,
    input logic             reset_n,

    output logic [127:0]    random_out
      );

logic [63:0] random0, random1;
logic [127:0] seed0, seed1;
logic reseed_r;

assign random_out = {random0, random1};

parameter INIT_STATE = 256'h15861073cd627c3bbe0cbc193fbba84857679dd55102fc490e7438daffda4055;

assign seed0 = seed[255:128];
assign seed1 = seed[127:0];
assign reseed_r = reseed;

// Instantiate the XORSHIFT128+ PRNGS
A_cse_ocs_dpa_aes10c_xorshift128plus X0(
      .random_out (random0), 
      .seed       (seed0),      
      .reseed     (reseed_r),   
      .clk        (clk),
      .reset_n    (reset_n)
      );

A_cse_ocs_dpa_aes10c_xorshift128plus X1(
      .random_out (random1), 
      .seed       (seed1),      
      .reseed     (reseed_r),   
      .clk        (clk),
      .reset_n    (reset_n)
      );

endmodule
